﻿import QtQuick 2.0
import QtQuick.Controls 2.12

Item{

    function setTimeout(cb, delayTime) {
        let timer = Qt.createQmlObject("import QtQuick 2.0;Timer{}", this, "timerCus")
        // console.log(timer)
        timer.interval = delayTime;
        timer.repeat = false;
        timer.triggered.connect(cb);
        timer.start();
    }

    function getTextWidth(text, fontSize){
        return text.replace(/[^\u0000-\u00ff]/g,"aa").length*fontSize/2
    }
}

